package com.baizhi.service.impl;

import com.baizhi.dao.CmfzLogDao;
import com.baizhi.entity.CmfzLog;
import com.baizhi.service.CmfzAdminService;
import com.baizhi.service.CmfzLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author: renpu
 * @Date: 2019/3/13 17:07
 * @Description:
 */
@Service
@Transactional
public class CmfzLogServiceImpl implements CmfzLogService {

    @Autowired
    private CmfzLogDao cmfzLogDao;
    @Override
    public Map selectLog(int rows,int page) {
        Map map=new HashMap();
        int start=(page-1)*rows;
        int pageSize=rows;
        List<CmfzLog> list=cmfzLogDao.selectLog(start,pageSize);
        int count=cmfzLogDao.selectConut();
        System.out.println(list);
        map.put("rows",list);
        map.put("total",count);
        return map;
    }

    @Override
    public void deleteOne(int[] ids) {
        for (int i = 0; i <ids.length ; i++) {
            cmfzLogDao.deleteOne(ids[i]);
        }
    }
}
